package thread.pool;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;

class WorkerThreads implements Runnable {
	private String message;
	public WorkerThreads(String s){
		this.message=s;
	}
	public void run(){
		System.out.println(Thread.currentThread().getName()+"(start)message"+message);
		processmessage();//call processmessage method that sleeps the thread for 2 seconds
		System.out.println(Thread.currentThread().getName()+"End");//print thread name
	}
	private void processmessage(){
		try{
			Thread.sleep(2000);
		}catch(InterruptedException e){
			e.printStackTrace();
		}
	}

}
